import Axios from '../plugins/axios'
import { HTTPTypes } from './type'
import { baseUrlForBusiness } from './config'

// 共用：组织详情
export class assetsManage {
  /**
   * 属性列表
   * @param params
   * @returns
  */
  static async getAssetsList(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/getNodeByNodeType`, params)
  }

  // 删除属性
  static async deleteNode(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.get(`${baseUrlForBusiness}/wes/ap/deleteNodeById`, { params })
  }

  // 编辑属性
  static async editNode(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/updateNode`, { ...params })
  }

  // 添加标签
  static async addLabels(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/addLabelById`, { ...params })
  }

  // addBizNode
  static async addBizNodeRequst(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/addBizNode`, params)
  }

  // addKnNode
  static async addKnNodeRequst(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/addKnNode`, params)
  }

  // addKeyNode
  static async addKeyNodeRequst(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/addKeyNode`, params)
  }

  // addValueNode
  static async addValueNodeRequst(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/addValueNode`, params)
  }

  // getNodeByNodeTypeAndId
  static async getNodeByNodeTypeAndId(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseUrlForBusiness}/wes/ap/getNodeByNodeTypeAndId`, params)
  }
}
